<?php

/**
 * 娱乐管理
 * User: admin
 * Date: 2017/12/11
 * Time: 16:42
 */
class Model_Video extends Model_Common
{

    /**
     * 首页轮播图
     */
    public function carousel(){
        $result = DI()->notorm->carousel
            ->order('uptime asc')
            ->fetchAll();
        return $result;
    }

    public function  videoList($position){
        if($position =="top"){
           $limit =6;
        }else{
            $limit=1000;
        }
        $result = DI()->notorm->video
            ->order('uptime desc')
            ->limit(0,$limit)
            ->fetchAll();
        $data['video'] =$result;
        $game_res = DI()->notorm->game_recommend
            ->order('uptime desc')
            ->limit(0,$limit)
            ->fetchAll();
        $data['game'] = $game_res;
        return $data;
    }
}